package com.qf.petmall.starter.navtop.controller;


import com.qf.petmall.starter.navtop.entity.Nav;
import com.qf.petmall.starter.navtop.service.INavService;
import com.qf.petmall.starter.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页导航栏 前端控制器
 * </p>
 *
 * @author Zhong_
 * @since 2022-12-07
 */
@CrossOrigin
@RestController
public class NavController {

    @Autowired
    INavService navService;
    @RequestMapping("/nav")

    @GetMapping("/nav")
    public R nav(){
        List<Nav> list = navService.list();

        return R.ok().put("nav",list);
    }
}
